package es.aa.android.cartomatic.implementations.service;

import android.app.Activity;
import android.content.Intent;
import es.aa.android.cartomatic.domain.Options;
import es.aa.android.cartomatic.interfaces.service.INavigationService;

/**
 * Created by Arturo on 30/08/2014.
 */
public class NavigationService implements INavigationService {
    @Override
    public void navigate(Activity activity, Class<? extends Activity> clazz) {
        Intent intent = new Intent(activity, clazz);
        
        if(activity.getIntent().getExtras() != null) {
        	intent.putExtra("EXTRA", activity.getIntent().getExtras());
        }
        
        activity.startActivity(intent);
    }
    
    public void navigate(Activity activity, Class<? extends Activity> clazz, Options options) {
        Intent intent = new Intent(activity, clazz);
        intent.putExtra("OPTIONS", options);
        activity.startActivity(intent);
    }
}
